//============================================================================
// Name        : cylindercg.cpp
// Author      : Benedikt Bovelette / Ingmar Hartung
// Version     :
// Copyright   : (c) 2012
// Description :
//============================================================================
#include "Header/cylindercg.h"
#include "Header/ground.h"

/* Oberer Zylinder */

void DrawCylinderOnTop(){
	GLUquadricObj* cyl;
	cyl = gluNewQuadric();
	
	initMaterial(6);
	glPushMatrix ();
		glTranslatef( 1.5, -0.25, 0.0 );
		/* Um 90 Grad nach links rotieren */
		glRotatef (-90., 1., 0., 0.);
		glColor3f (.5, .5, .5);
		gluCylinder(cyl,0.1, 0.2, 0.1, 100, 100);
    glPopMatrix ();
}


/* Turm */
void DrawCylinder()
{
	GLUquadricObj* cyl;
	cyl = gluNewQuadric();
	glTranslatef( 1.5, -2.05, 0.0 );

	glPushMatrix ();
		glColor3f (1., 1., 1.);
		glRotatef (-90., 1., 0., 0.);
		glColor3f (.4, .0, .0);
		initMaterial(5);
		gluCylinder(cyl,0.2, 0.2, 0.85, 100, 10);
    glPopMatrix ();
        
	glPushMatrix ();
		glColor3f (1., 1., 1.);
		glRotatef (-90., 1., 0., 0.);
		glColor3f (.5, .5, .5);
		initMaterial(6);
		gluCylinder(cyl,.25, 0.125, 1.85, 100, 1000);
    glPopMatrix ();
}

/* Untere Zylinder */
void DrawCylinderOnButtom(){
	GLUquadricObj* cyl;
	cyl = gluNewQuadric();
	

	glPushMatrix ();
		glColor3f (1., 1., 1.);
		glRotatef (-90., 1., 0., 0.);
		glColor3f (.0, .1, .0);
		initMaterial(8);
		gluCylinder(cyl,0.25, 0.25, 0.1, 100, 100);
		glColor3f (.0, .2, .0);
		initMaterial(7);
		gluCylinder(cyl,0.25, 0.24, 0.2, 100, 100);
		glColor3f (.0, .3, .0);
		initMaterial(9);
		gluCylinder(cyl,0.25, 0.23, 0.3, 100, 100);
    glPopMatrix ();
}
